<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <meta http-equiv="X-UA-Compatible" content="IE=edge">  
    <meta name="viewport" content="width=device-width, initial-scale=1">  
    <title>输入框组——改进版</title>  
    <link rel="stylesheet" href="css/bootstrap.css" type="text/css">  
    <link rel="stylesheet" href="css/mystyle.css" type="text/css">
    <!--<link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />-->  
    <!--[if lt IE 9]>  
    <script src="js/html5shiv.js"></script>  
    <script src="js/respond.min.js"></script>  
    <![endif]-->  
    <link href="css/font-awesome.min.css" rel="stylesheet">
</head>  
<body>  
    <div class="container">
    	<form action="">
        <div class="editor">
		</div>
		<div class="editor">
		</div>
		<textarea required></textarea>
		<button type="submit">tijiao</button>
		</form>
    </div>  
	<button id="code_send_btn" disabled></button>
  
    <script src="js/jquery-1.12.4.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="editor/wangEditor.js"></script>
    <script type="text/javascript"> 
  
    var E = window.wangEditor;
    var elements = $('.editor');
    for(var i=0;i<elements.length;i++){
    	var editor = new E(elements[i]);
    	// 自定义菜单配置
    	editor.customConfig.menus = [
            'head',
            'emoticon'//加入空格
        ];
        editor.create();
    }
    
    var textWidth = function(text){ 
        var sensor = $('<pre>'+ text +'</pre>').css({display: 'none'}); 
        $('body').append(sensor); 
        var width = sensor.width();
        sensor.remove(); 
        return width;
    };
    function changeText(obj){
        $(obj).width(textWidth($(obj).val())+15);
    }
	
	 function timeInterval(time){
		$("#code_send_btn").html(time+"后重新获取邮箱验证码");
		var timeSec = time-1;
		var timeStr = '';
		var codeTime = setInterval(function Internal(){
			if (timeSec <= 0){
				alert(0)
				$("#code_send_btn").html("获取邮箱注册码");
				$("#code_send_btn").removeAttr("disabled","disabled");
				clearInterval(codeTime);
				return;
		    }

			timeStr = "("+parseInt(timeSec/60)+":"+(timeSec%60)+")获取邮箱注册码";
			$("#code_send_btn").html(timeStr);
			timeSec--;
		},1000);
	}
	timeInterval(65)
    </script>
  
</body>  
</html>  